<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<!-- 上传插件 -->
<link rel="stylesheet"
	href="/ajax/plugins/bootstrap-fileinput/css/fileinput.css"
	th:href="@{/ajax/plugins/bootstrap-fileinput/css/fileinput.css}" />
<link href="/css/font-awesome.css" th:href="@{/css/font-awesome.css}"
	rel="stylesheet" />
<link href="/ajax/libs/iCheck/custom.css"
	th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet" />
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-loginSet-edit">
			<input id="basesetId" name="basesetId" type="hidden"
				th:value="${baseset.basesetId}"></input> <input id="loginbgType"
				name="loginbgType" type="hidden" th:value="${baseset.loginbgType}"></input>
			<input id="loginbgName2" name="loginbgName2" type="hidden"
				th:value="${baseset.loginbgName}"></input>
				<input id="loginbgFileName" name="loginbgFileName" type="hidden"
				th:value="${baseset.loginbgFileName}"></input>
			<div class="form-group">
				<label class="col-sm-2 control-label">登录背景：</label>
				<div class="col-sm-7">
					<label class="checkbox-inline i-checks" id="clickLabel1"> <input
						type="radio" name="toolCodeType" value="0" id="radio1" /> 在线编辑
					</label> <label class="checkbox-inline i-checks" id="clickLabel2">
						<input type="radio" name="toolCodeType" value="1" id="radio2" />
						图片上传
					</label><label class="checkbox-inline i-checks" id="clickLabel3"> <input
						type="radio" name="toolCodeType" value="2" id="radio3" /> 特效背景
					</label>
				</div>
				<div class="form-control-static col-sm-offset-9">
					<a class="btn btn-success btn-sm" onclick="previewLoginbg(this)"
						target="_Blank"><i class="fa fa-edit"></i>预览</a>
				</div>
			</div>
			<div class="form-group" style="display: none" id="show1">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-8">
					<input id="loginbgName" name="loginbgName" class="form-control"
						type="text" placeholder="可直接填写图片链接">
				</div>
			</div>
			<div class="form-group" style="display: none" id="show2">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-8">
					<input id="file-5" class="file" type="file" name="file">
				</div>
			</div>

			<!-- 特效区 -->
			<div class="form-group" style="display: none" id="show3">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-8">
					<select class="form-control" name="specialEffects"
						id="specialEffects">
						<option value="0">星星特效</option>
						<option value="1">行星运转</option>
						<option value="2">3D文字球</option>
						<option value="3">成长树</option>
						<option value="4">太阳系</option>
						<option value="5">粒子波浪</option>
						<option value="6">跳动时间</option>
						<option value="7">网粒效果</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button th:onclick="'javascript:layer_close()'"
						class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>
		</form>
	</div>
	<div th:include="include::footer"></div>
	<script src="/rzspider/tool/baseset/detailedit/loginSetEdit.js"
		th:src="@{/rzspider/tool/baseset/detailedit/loginSetEdit.js}">
		
	</script>
	<script src="/ajax/plugins/bootstrap-fileinput/js/fileinput.min.js"
		th:src="@{/ajax/plugins/bootstrap-fileinput/js/fileinput.min.js}"></script>
	<script src="/ajax/plugins/bootstrap-fileinput/js/locales/zh.js"
		th:src="@{/ajax/plugins/bootstrap-fileinput/js/locales/zh.js  }"></script>
	<script src="/ajax/plugins/bootstrap-fileinput/js/locales/fr.js"
		th:src="@{/ajax/plugins/bootstrap-fileinput/js/locales/fr.js  }"></script>
	<script src="/ajax/libs/iCheck/icheck.min.js"
		th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
	<script>
		$(document).ready(function() {
			$(".i-checks").iCheck({
				checkboxClass : "icheckbox_square-green",
				radioClass : "iradio_square-green",
			})
		});
	</script>
	<script>
		var imgFileName;
		var originalFileName = "";
		// 上传文件
		$("#file-5")
				.fileinput(
						{
							language : 'zh', // 设置语言
							uploadUrl : ctx
									+ "tool/baseset/detailedit/uploadFile/"
									+ $('#basesetId').val() + "/3",
							allowedFileExtensions : [ 'jpg', 'png', 'jpeg',
									'gif' ],// 接收的文件后缀
							showUpload : true, // 是否显示上传按钮
							showCaption : false,// 是否显示标题
							browseClass : "btn btn-primary", // 按钮样式
							dropZoneEnabled : true,//是否显示拖拽区域
							uploadAsync : true,
							showBrowse : true,
							browseOnZoneClick : false,
							maxFileCount : 1, // 表示允许同时上传的最大文件个数
							enctype : 'multipart/form-data',
							maxFileSize : 1500
						//直接存到数据库，大小不超过1m
						// 单位为kb，如果为0表示不限制文件大小
						})
				.on("filebatchselected", function(event, files) {
					//返回文件名
					originalFileName = files[0].name;
				})
				.on(
						"fileuploaded",
						function(event, data) {
							//返回文件名,改过，实际返回base64编码
							imgFileName = data.response.imgbase64String;
							//重命名后的文件名
							$('#loginbgFileName').val(data.response.fileName);
						});
	</script>
</body>
</html>
